//
//  NetWorkingHandler.m
//  UI22_NSURLSession
//
//  Created by 宝龙 on 16/6/1.
//  Copyright © 2016年 宝龙. All rights reserved.
//


#import <Foundation/Foundation.h>

@protocol NetworkingManagerDelegate <NSObject>

- (void)didCompleteWithJSONResult:(id)result receiveData:(NSData *)data;

@end

@interface NetworkingManager : NSObject

@property (nonatomic, assign) id<NetworkingManagerDelegate> delegate;

+ (instancetype)manager;

- (BOOL)canConnectNetWork;

- (void)networkConnectStatus;
#pragma mark - GET,POST 请求
//原生请求方法
- (void)getDataWithURLString:(NSString *)URLString
                  HTTPMethod:(NSString *)httpMethod
                    HTTPBody:(NSDictionary *)httpBody
                    andToken:(NSString *)token forHTTPHeaderField:(NSString *)hearderField
                  completion:(void (^)(id result, NSData *data, NSURLResponse *response, NSError *error))completion;

//AF请求
- (void)AFGetDataWithUrlString:(NSString *)urlString
                    HTTPMethod:(NSString *)httpMethod
                      HTTPBody:(NSDictionary *)httpBody
                      andToken:(NSString *)token forHTTPHeaderField:(NSString *)hearderField
               successfulBlock:(void(^)(id result))successfulBlock
                   failedBlock:(void (^)(id error))failedBlock;


#pragma mark - GET
//- (void)netWorkingHandlerGETWithURL:(NSString *)string completion:(void(^)(id result, NSData *data, NSURLResponse *response, NSError *error))completion;
//- (void)networkingHandlerGetWithURL:(NSString *)string;

#pragma mark - POST
//- (void)networkingHandlePOSTWithURL:(NSString *)urlstring httpBody:(NSString *)body completion:(void (^)(id result, NSData *data, NSURLResponse *response, NSError *error))completion;


//- (void)networkingHandlePOSTWithURL:(NSString *)urlstring httpBody:(NSString *)body;













@end
